﻿using System;

using System.Collections.Generic;
using System.Text;

namespace PublicTransport.GpsNavigation
{
    class FakeGps
    {
        private bool DEBUG_GPS = true; //zapnutie debugovania - "fake" gps koordinaty

        private int RANDOMNESS = 1000; //nizsie cislo = vyssia rychlost pohybu suradnic
        private GpsPoint debugGpsPoint = new GpsPoint(48.704323, 21.250112); //debug na lomonosovovu
        private static FakeGps instance;
        public static FakeGps Instance
        {
            get
            {
                if (instance == null)
                {
                    instance = new FakeGps();
                }
                return instance;
            }
        }

        private FakeGps()
        {
        }

        public bool enabled()
        {
            return DEBUG_GPS;
        }

        public GpsPoint getCoordinates()
        {
            Random random = new Random();
            debugGpsPoint.X += (random.NextDouble() - 0.5) / RANDOMNESS;
            debugGpsPoint.Y += (random.NextDouble() - 0.5) / RANDOMNESS;
            return debugGpsPoint.clone();
        }
    }
}
